package pert;

import java.util.Arrays;
import java.util.HashSet;

public class Pert {
	public static void main(String[] args) {
		if (args.length == 0) {
			PertToDot conversion = new PertToDot();
			HashSet<Task> allTasks = new HashSet<Task>(
					conversion.convertCsvToClass("C:/temp/PERTchart.pert"));
			System.out.println("Critical Path starting from the end: "
					+ Arrays.toString(CriticalPath.criticalPath(allTasks)));
			if (!conversion.convertPertToDot("C:/temp/PERTchart.pert")) {
				System.out.println("Invalid input.");
			} else {
				System.out.println("Operation successful.");
			}
		} else {
			System.out
					.println("Do not use arguments and place input-pert file in C:/temp/PERTchart.pert.");
		}
	}
}